#include <iostream>
#include <unordered_map>
#include <unordered_set>

template <typename T>
void Print(const T &v)
{
    for (auto ite = v.begin(); ite != v.end(); ite++)
    {
        std::cout << *ite << " ";
    }
    std::cout << std::endl;
}

int main()
{
#if 0
    std::unordered_set<int> s;
    s.insert(2);
    s.insert(1);
    s.insert(3);

    auto ite = s.find(4); // 查找
    // 找不到就返回end迭代器
    if (ite != s.end()) 
    {
        std::cout << *ite << std::endl;
    } 
    else
    {
        std::cout << "找不到" << std::endl;
    }

    s.erase(1);
    Print(s);
#endif

#if 1
    std::unordered_map<int, std::string> m;
    m[2] = "zhangsan";
    m[3] = "lisi";
    m[1] = "wangwu";

    for (auto ite = m.begin(); ite != m.end(); ite++)
    {
        std::cout << ite->first << " " << ite->second << std::endl;
    }
#endif

    return 0;
}